package com.daka.service.impl;

import com.daka.dao.MemberOrgDao;
import com.daka.entity.MemberOrg;
import com.daka.service.MemberOrgService;
import com.daka.tools.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by yangx
 * CreateTime: 2016/9/18 16:33
 */

@Service("memberOrgService")
@Transactional
public class MemberOrgServiceImpl implements MemberOrgService {

    @Autowired
    private MemberOrgDao memberOrgDao;

    @Override
    public int insert(MemberOrg po) {
        po.setCreatetime(DateUtil.getDate());
        return memberOrgDao.insert(po);
    }

    @Override
    public int update(MemberOrg po) {
        return memberOrgDao.updateByPrimaryKeySelective(po);
    }

    @Override
    public MemberOrg selectByPrimaryKey(Integer id) {
        return memberOrgDao.selectByPrimaryKey(id);
    }

    @Override
    public List<MemberOrg> checkLader(Integer memberId) {
        return memberOrgDao.checkLader(memberId);
    }

    @Override
    public List<MemberOrg> selectByStatement(MemberOrg po) {
        return memberOrgDao.selectByStatement(po);
    }

}
